﻿using System;
using System.Data;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Configuration;
using KPIS.DBM;
using KPIS.GERP.GBMS.DAL;
using KPIS.GERP.GBMS.MODEL;
using KPIS.GERP.GBMS.DALFactory;
using KPIS.GERP.GBMS.IBLL;

namespace KPIS.GERP.GBMS.BLL
{
    public class BgmKpiListBLL : IBgmKpiListBLL
     {
        private static readonly IBgmKpiListDAL dal = DataAccess.CreateBgmKpiList();

        public DataTable Search(int? intStrategyMapSeq, int? intKpiYear, string strKpiName, string strKpiUnit,
                                 string target_name, string record_status, string strType)
        {
            return dal.Search(intStrategyMapSeq, intKpiYear, strKpiName, strKpiUnit, target_name, record_status, strType);
        }

        public string Insert(int intStatMapping, int intTargetSeq, int intKpiYear, int intCreatedBy
                            ,string strKpiName, string strDes, string strKpiType, string strKpiUnit, int? intKpiWeight
                            ,string strType)
        {
            return dal.Insert(intStatMapping, intTargetSeq, intKpiYear, intCreatedBy,
                              strKpiName, strDes, strKpiType, strKpiUnit, intKpiWeight, strType);
        }

        public void Update(string strKpiSeq, string strKpiName, string strDes, string strKpiUnit, string strKpiType,
                            string strKpiWeight, string created_by, string strType)
        {
            dal.Update(strKpiSeq, strKpiName, strDes, strKpiUnit, strKpiType, strKpiWeight, created_by, strType);
        }

        public void Delete(string strKpiSeq, string created_by)
        {
            dal.Delete(strKpiSeq, created_by);
        }

        public List<MODEL.BGMKPI> LoadGridKpiTarget(string target_seq)
        {
            return dal.LoadGridKpiTarget(target_seq);
        }

        public DataTable LoadKpiTarget()
        {
            return dal.LoadKpiTarget();
        }

        public DataTable LoadKpiType()
        {
            return dal.LoadKpiType();
        }

        public void InsertTarget(string strBgmKpiSeq, string strStatMapping, Dictionary<int, double?> scores, string created_by)
        {
            dal.InsertTarget(strBgmKpiSeq, strStatMapping, scores, created_by);
        }

        public bool CheckValue(string strKpiSeq)
        {
            return dal.CheckValue(strKpiSeq);
        }

        public string CheckNameKpiTarget(int? intStrategyMapSeq, string strType)
        {
            return dal.CheckNameKpiTarget(intStrategyMapSeq, strType);
        }

        public DataTable SearchTarget(string strKpiSeq)
        {
            return dal.SearchTarget(strKpiSeq);
        }

        public void UpdateTarget(string strKpiDetSeq, double? dblKpiDetTarget, string created_by)
        {
            dal.UpdateTarget(strKpiDetSeq, dblKpiDetTarget, created_by);
        }
        public void DeleteTarget(string strKpiSeq, string created_by)
        {
            dal.DeleteTarget(strKpiSeq, created_by);
        }

     }
}   
